public class RobotManuel extends Robot
{
	public RobotManuel(Labyrinthe lab)
	{
		super(lab, new int[]{Labyrinthe.UP, Labyrinthe.RIGHT, Labyrinthe.DOWN, Labyrinthe.LEFT});
	}
	
	public int findExit()
	{
		throw new UnsupportedOperationException();
	}

	public boolean play()
	{
		laby.affichage();
		
		if (laby.isExit()) return false; //found
		
		System.out.println("WALLS");
		System.out.println("/"+(super.isWall(Labyrinthe.UP) ? "W" : "-")+"\\");
		System.out.println((super.isWall(Labyrinthe.LEFT) ? "W" : "-")+" "+
							(super.isWall(Labyrinthe.RIGHT) ? "W" : "-"));
		System.out.println("\\"+(super.isWall(Labyrinthe.DOWN) ? "W" : "-")+"/");
		
		System.out.println("VISIT");
		System.out.println("/"+(super.canVisit(Labyrinthe.UP) ? "V" : "-")+"\\");
		System.out.println((super.canVisit(Labyrinthe.LEFT) ? "V" : "-")+" "+
							(super.canVisit(Labyrinthe.RIGHT) ? "V" : "-"));
		System.out.println("\\"+(super.canVisit(Labyrinthe.DOWN) ? "V" : "-")+"/");
		
		String cmd = System.console().readLine("MOVE: ");
		if (cmd.equals("z")) super.move(Labyrinthe.UP);
		else if (cmd.equals("d")) super.move(Labyrinthe.RIGHT);
		else if (cmd.equals("x") || cmd.equals("s")) super.move(Labyrinthe.DOWN);
		else if (cmd.equals("q")) super.move(Labyrinthe.LEFT);
		else if (cmd.equals("<")) return false;
		
		return true; //continue
	}
}
